package com.zzb.myshowme.model.impl;

import android.util.Log;

import com.zzb.myshowme.MyApplication;
import com.zzb.myshowme.bean.UserInfo;
import com.zzb.myshowme.model.UserCenterModel;
import com.zzb.myshowme.utils.UserInfoUtils;
import com.zzb.myshowme.utils.HttpManager;

import rx.Subscriber;

/**
 * Created by Administrator on 2016/11/1.
 */
public class UserCenterModelImpl implements UserCenterModel{

    @Override
    public void getUserInfo(){
//        HttpManager.getInstance().doHttpRequest(HttpManager.getInstance().getHttpService().getUserInfo(phone), new Subscriber<String>() {
        HttpManager.getInstance().doHttpRequest(HttpManager.getInstance().getHttpService().testReq(), new Subscriber<String>() {
            @Override
            public void onCompleted() {
                Log.d("upload", "onCompleted down 成功======");

            }

            @Override
            public void onError(Throwable e) {
                Log.d("down", "onError 上传头像======" + e.getMessage());
            }

            @Override
            public void onNext(String string) {
                UserInfo user = new UserInfo();
                user.setUser("13512312345");
                user.setSex("男");
                user.setNickName("SuperBin");
                user.setCity("深圳");
                UserInfoUtils.writeLoginMember(MyApplication.getInstance(), user);//保存到文件中
            }
        });
    }
}
